<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <input type="button" id="btn" value="按钮" onclick="on()">
    <br>
    <br>
    
    <input type="text" onfocus="f()">
    <br>
    <br>
    
    <div onmouseover="m()" onmouseout="o()">黑马程序员</div>
    <br>
    <hr>
    <div id="info"></div>
    <hr>
    

</body>
<script>
    function on(){
        console.log('您点击了按钮');
        document.getElementById("info").innerHTML='您点击了按钮'
    }

    function b(){
        console.log('您失去了焦点');
        document.getElementById("info").innerHTML='您失去了焦点'
    }


    function f(){
        console.log('您聚焦了');
        document.getElementById("info").innerHTML='您聚焦了'
    }

    function m(){
        console.log('鼠标移动上来了');
        document.getElementById("info").innerHTML='鼠标移动上来了'
    }

    function o(){
        console.log('鼠标移开了');
        document.getElementById("info").innerHTML='鼠标移开了'
    }


    // document.getElementById('btn').onclick = function(){
    //     alert('您点击了按钮');
    // }
</script>
</html>